﻿using Avalon.Core.Data;
using Avalon.Core.MVC.Actions;
using Avalon.Core.MVC.Attributes;
using Avalon.Core.MVC.StateBags;
using System.Collections.Generic;

namespace Avalon.Core.MVC.Pipelines {
    [PipelineAttribute("Get")]
    public class GetPipeline<TModel> : BasePipeline where TModel : class, IEntity, new() {

        public GetPipeline() {
            PipelineActions.Add(new GetEntityAction<TModel>() { Index = 0 });
        }

        public override void InitializeStateBag() {
            this.StateBag = new EntityBag<TModel>();
            addParameter("id");
        }
    }
}
